package com.jlpay.openapi.demo.marketing;

import com.jlpay.open.jlpay.sdk.java.model.marketing.request.MarketingActivityQueryRequest;
import com.jlpay.open.jlpay.sdk.java.model.marketing.response.MarketingActivityQueryResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import com.jlpay.openapi.demo.openmerch.query.MerchBaseInfoQueryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author liaochangyi
 * @date 2025-08-08  09:18
 */
public class MarketingActivityQueryService {

    private static final Logger LOGGER = LoggerFactory.getLogger(MerchBaseInfoQueryService.class);

    public static void main(String[] args) {
        MarketingActivityQueryRequest activityQueryRequest = buildMarketingActivityQueryRequest();
        MarketingActivityQueryResponse response = JlpayOpenApiService.openMerchService()
                .post(activityQueryRequest, MarketingActivityQueryResponse.class);
        LOGGER.info("营销活动ID查询响应:{}", JsonUtils.toString(response));
    }

    private static MarketingActivityQueryRequest buildMarketingActivityQueryRequest() {
        MarketingActivityQueryRequest activityQueryRequest = new MarketingActivityQueryRequest();
        // 商户号
        activityQueryRequest.setSponsorId("61000005");
        return activityQueryRequest;
    }
}
